import request from '@/utils/request'

// 封装获取权限点列表的请求
export function getPermissionList() {
  return request({
    url: '/sys/permission',
    method: 'get'
  })
}

// 封装新增权限点的请求
export function addPermission(data) {
  return request({
    url: '/sys/permission',
    method: 'post',
    data
  })
}

// 封装获取权限点详情的请求
export function getPermissionDetail(id) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'get'
  })
}

// 封装删除权限点的请求
export function deletePermission(id) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'delete'
  })
}

// 封装修改权限点详情的请求
export function editPermission(data) {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'put',
    data
  })
}